      SUBROUTINE SETUP
      RETURN
      END
C   HS86
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),G17(5,5),D17(5),E17(5),FX,S,S1
      SAVE E17,D17,G17
      DATA E17/-15.D0,-27.D0,-36.D0,-18.D0,-12.D0/
      DATA G17/30.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,39.D0,-6.D0
     1        ,-31.D0,32.D0,-10.D0,-6.D0,10.D0,-6.D0,-10.D0,32.D0,
     2 -31.D0,-6.D0,39.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,30.D0/
      DATA D17/4.D0,8.D0,10.D0,6.D0,2.D0/
      ICF=ICF+1
      S=0.D0
      DO      200      I=1,5
      S1=0.D0
      DO      100      J=1,5
      S1=S1+G17(I,J)*X(J)
  100 CONTINUE
      S=S+(S1+E17(I)+ D17(I)*X(I)**2)*X(I)
  200 CONTINUE
      FX=S
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),GRADF(NX),G17(5,5),D17(5) ,E17(5) 
      DOUBLE PRECISION S
      INTEGER I,J
      SAVE E17,G17,D17
      DATA E17/-15.D0,-27.D0,-36.D0,-18.D0,-12.D0/
      DATA G17/30.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,39.D0,-6.D0
     1        ,-31.D0,32.D0,-10.D0,-6.D0,10.D0,-6.D0,-10.D0,32.D0,
     2 -31.D0,-6.D0,39.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,30.D0/
      DATA D17/4.D0,8.D0,10.D0,6.D0,2.D0/
      ICGF=ICGF+1
      DO      200      I=1,5
      S=0.D0
      DO      100      J=1,5
      S=S+G17(I,J)*X(J)
  100 CONTINUE
      GRADF(I)=S+S+E17(I)+3.D0*D17(I)*X(I)**2
  200 CONTINUE
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GRADHI(NX)
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),B17(10),A17(10,5),GXI,S
      SAVE A17,B17
      DATA A17/-16.D0,0.D0,-3.5D0,0.D0,0.D0,2.D0,-1.D0,-1.D0,2*1.D0,
     1        2.D0,-2.D0,0.D0,-2.D0,-9.D0,0.D0,-1.D0,-2.D0,2.D0,1.D0,
     2     2*0.D0,2.D0,0.D0,-2.D0,-4.D0,-1.D0,-3.D0,3.D0,1.D0,
     3     1.D0,.4D0,0.D0,-4.D0,1.D0,0.D0,-1.D0,-2.D0,4.D0,1.D0,
     4     0.D0,2.D0,0.D0,-1.D0,-2.8D0,0.D0,-1.D0,-1.D0,5.D0,1.D0/
      DATA B17/-40.D0,-2.D0,-.25D0,-4.D0,-4.D0,-1.D0,-40.D0,-60.D0
     1        ,5.D0,1.D0/
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      IF( I .GT.10)      GOTO 200
      S=0.D0
      DO      100      J=1,5
      S=S+A17(I,J)*X(J)
  100 CONTINUE
      GXI=S-B17(I)
      RETURN
  200 CONTINUE
      GXI=X(I-10)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),GRADGI(NX),A17(10,5)
      SAVE A17
      DATA A17/-16.D0,0.D0,-3.5D0,0.D0,0.D0,2.D0,-1.D0,-1.D0,2*1.D0,
     1        2.D0,-2.D0,0.D0,-2.D0,-9.D0,0.D0,-1.D0,-2.D0,2.D0,1.D0,
     2     2*0.D0,2.D0,0.D0,-2.D0,-4.D0,-1.D0,-3.D0,3.D0,1.D0,
     3     1.D0,.4D0,0.D0,-4.D0,1.D0,0.D0,-1.D0,-2.D0,4.D0,1.D0,
     4     0.D0,2.D0,0.D0,-1.D0,-2.8D0,0.D0,-1.D0,-1.D0,5.D0,1.D0/
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
      IF( I .GT. 10)      GOTO 200
      DO      100      J=1,5
      GRADGI(J)= A17(I,J)
  100 CONTINUE
      RETURN
  200 CONTINUE
      DO      300      J=1,5
      GRADGI(J)=0.D0
  300 CONTINUE
      GRADGI(I-10)=1.D0
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS86'/
C     DATA X/11*1.D-4,60.D0,3*1.D-4,35*0.D0/
      DATA (X(I),I=1,5)/4*0.D0 , 1.D0/
      DATA N/ 5/ , NH/0/ , NG/15/
      DATA DEL0/0.04D0/ ,TAU0/0.10D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,15)
     F           /-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,
     F           -1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,
     F           1,1,1,1,2,1,1,3,1,1,4,1,1,5,1/
      END
